<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        img {
            position: absolute;
        }
        
        #box {
            margin-top: 1000px;
        }
    </style>
</head>

<body>
    <div id="box"></div>
    <img src="images/bpic_1.gif" id="ts">

    <script>
        var ts = document.getElementById("ts");
        //鼠标移动的时候
        document.onmousemove = function(e) {
            //clientX 在可视窗口中的位置
            //e事件参数
            ts.style.left = e.clientX + "px";
            ts.style.top = e.clientY + "px";

            //获取鼠标的位置
            // console.log(e.clientX);
            // console.log(e.clientY);
        }
    </script>
</body>

</html>